<%@page import="java.util.ArrayList"%>
<%@page import="com.portal4kids.model.PeopleVisitPlan"%>
<%@page import="java.util.List"%>
<%@page import="com.portal4kids.model.People"%>
<%@page import="com.portal4kids.controller.PeopleManager"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Portal4kids</title>
</head>
<body>
	<%
	String id = request.getParameter("id");
	if( id != null && "login".equals(id)){
		String login = request.getParameter("login");
		String password = request.getParameter("password");
		
		PeopleManager peopleController = new PeopleManager();
		
		People people = peopleController.getPeopleIfRegister(login, password);
		if(people != null){
			session.setAttribute("user", people);
			 
		
		}
	}else if("logout".equals(id)){
		session.removeAttribute("user");
	}
	%>
	
	<jsp:forward page="userPanel.jsp"></jsp:forward>
</body>
</html>